<?php
//$strThumbPath = "./images/thumbz/";
//$strDefaultPath = "./images/default/";
//Picture size set in CSS

echo "<ul class='hoverbox'>";
//Loop through directory and echo results into a list
if(is_dir($strThumbPath)){
	$strHandle=opendir($strThumbPath);
	while ($strFile = readdir($strHandle)) {
		//if($strHandle){
			$strExt=strtolower(substr($strFile,-3,3));
			echo "pos ".strpos($strFile,$strPicturePrefix);
			//if file is a jpg and page number and item number match
			if(($strExt=="jpg") && (strpos($strFile,$strPicturePrefix)> 0)){
				echo "
					<li>
						<a href='#'><img src='".$strThumbPath.$strFile."' alt='$strFile' /><img src='".$strDefaultPath.$strFile."'  class='preview' alt='' /></a><br />".substr($strFile,strpos($strFile,"item"))."
					</li>	
				";
			}
		//}
	}
}
echo "</ul>";
?>